package com.windystory.wslibrary.base.guide;

import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.windystory.wslibrary.R;
import com.windystory.wslibrary.base.fragment.BaseFragment;
import com.windystory.wslibrary.util.event.Event;

/**
 * BaseGuideFragment 导航欢迎页Fragment
 * 注意最后一个有按钮的Fragment自己构造并添加到List中
 * Created by windystory on 08/23/2019.
 */
public class BaseGuideFragment extends BaseFragment {

    private ImageView guideIMG;


    public static BaseGuideFragment newInstance(int imageRes) {
        BaseGuideFragment fragment = new BaseGuideFragment();

        Bundle args = new Bundle();
        args.putInt("res", imageRes);
        fragment.setArguments(args);

        return fragment;
    }

    @Override
    protected void initData() {
        Glide.with(getActivity()).load(getArguments().getInt("res")).into(guideIMG);
    }

    @Override
    protected void initListener() {

    }

    @Override
    protected int getLayoutResId() {
        return R.layout.fragment_guide;
    }

    @Override
    protected void initView(View v) {
        guideIMG = v.findViewById(R.id.guideIMG);
    }

    @Override
    protected void onEventDealWith(Event eventConfig) {

    }
}
